package com.train.SRP;

import com.train.SRP.vehicle.AirVehicle;
import com.train.SRP.vehicle.RoadVehicle;
import com.train.SRP.vehicle.Vehicle;
import com.train.SRP.vehicle.WaterVehicle;

/**
 * 单一职责原则（Single Responsibility Principle, SRP）
 * 1.遵循单一职责规则，每个类仅负责有限的功能
 * */
public class Main {
    public static void main(String[] args) {
        AirVehicle airVehicle = new AirVehicle();
        airVehicle.run("飞机");
        RoadVehicle roadVehicle = new RoadVehicle();
        roadVehicle.run("巴士");
        WaterVehicle waterVehicle = new WaterVehicle();
        waterVehicle.run("游轮");

        Vehicle vehicle = new Vehicle();
        vehicle.airRun("飞机");
        vehicle.roadRun("客车");
        vehicle.waterRun("游轮");
    }
}
